package org.decorator.entity.condiment;

import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.decorator.entity.beverage.Beverage;

import java.math.BigDecimal;

/**
 * Mocha咖啡对象
 *
 * @author LiKun
 * @date 2021/8/10 1:39
 */
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class Mocha extends Condiment {
    private Beverage beverage;

    @Override
    public BigDecimal cost() {
        BigDecimal price = BigDecimal.valueOf(1.98);
        return price.add(beverage.cost());
    }

    @Override
    public String getDescription() {
        return beverage.getDescription() + ", Mocha";
    }
}
